package 二叉树.Basic;

/**
 * 二叉搜索树
 */
public class BinarySearchTree<E> {
    private int size;

    private Node<E> root;

    int size() {
        return size;
    }

    boolean isEmpty() {
        return size == 0;
    }

    void clear() {

    }

    void add(E element) {

    }

    void remove(E element) {

    }

    boolean contain(E element) {

        return false;
    }

    /**
     * 节点
     */
    private static class Node<E> {
        E element;
        Node<E> left;
        Node<E> right;
        Node<E> parent;

        public Node(E element, Node<E> parent) {
            this.element = element;
            this.parent = parent;
        }

        public boolean isLeaf() {
            return left == null && right == null;
        }

        public boolean hasTwoChildren() {
            return left != null && right != null;
        }
    }
}
